import unittest

from lib.HTMLTestRunner import HTMLTestRunner

if __name__ == '__main__':
    # 找到测试用例
    suite = unittest.defaultTestLoader.discover("./test_case", "*Test.py")
    # 执行
    # unittest.TextTestRunner().run(suite)
    # 生成测试报告
    # 指定测试报告位置
    path = "report/TestReport.html"
    file = open(path, 'wb')  # b表示二进制
    HTMLTestRunner(stream=file, verbosity=1, title="自动化测试报告", description="测试环境：Firefox").run(suite)
